$def with (post)
<html>
<head>
    <title>post</title>
    <script type="text/javascript" src="/static/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
	    tinyMCE.init({
	    //mode : "textareas",
	    //theme : "simple"
	    mode : "textareas",
	    theme : "advanced",
	    theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
	    theme_advanced_buttons2 : "undo,redo,|,link,unlink,anchor,image,cleanup,help,code,forecolor,backcolor",
	    theme_advanced_buttons3 : "",
	    theme_advanced_toolbar_location : "top",
	    theme_advanced_toolbar_align : "left",
	    theme_advanced_statusbar_location : "bottom"
	    });
    </script>
    <script type="text/javascript">
        function deletepost(){
            if(confirm('Delete this post?')){
                document.deleteform.submit();
            }else{
                return;
            }
        }
        //ajax取得tags
        function getTags(){
            var xmlHttp = null;
	    if(window.XMLHttpRequest)
		    xmlHttp = new XMLHttpRequest();
	    else if(window.ActiveXObject)
		    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	    xmlHttp.onreadystatechange = function(){
		    if(xmlHttp.readyState==4){
			    if(xmlHttp.status==200){
				    showTags(xmlHttp.responseXML);
			    }
		    }
	    }
	    var href = "http://localhost:8080/tag/getTags";//+encodeURIComponent("timeStamp")+encodeURIComponent(new Date().getTime())+"&amp;"+encodeURIComponent("cmdACT")+"="+encodeURIComponent("getBookrecnos");
	    xmlHttp.open("GET",href,true);
	    xmlHttp.send(null);
        }
	function showTags(data){
	    var tags = data.getElementsByTagName("tags")[0].getElementsByTagName("tag");
	    //.firstChild.data
	    /**
	    var innerTags = "";
	    for(var i=0;i<tags.length;i++){
		innerTags += "<li>"+tags[i].firstChild.data+"</li>";
	    }
	    innerTags = "<ul>"+innerTags+"</ul>";
	    document.getElementById("tags").innerHTML = innerTags;
	    */
	    var existedTags = document.getElementById("tags");
	    existedTags.innerHTML = "";  //先清空上一次的
	    for(var i=0;i<tags.length;i++){
		var obj = document.createElement("a");
		obj.className = "";
		obj.setAttribute("id","existedTag"+i);
		//obj.style.setAttribute("background","#ffff99");
		//obj.style.setAttribute("background","#0000ff");  //blue
		//obj.style.setAttribute("color","#ffffff");  //white
		obj.setAttribute("tagValue",tags[i].firstChild.data);
		obj.setAttribute("selected","false");
		//obj.setAttribute("href","javascript:swapTag('"+tagsArray[i]+"','"+obj.id+"');");
		obj.setAttribute("href","javascript:void(0);");
		obj.onclick=function(){swapTag(this)};
		obj.appendChild(document.createTextNode(tags[i].firstChild.data));
		existedTags.appendChild(obj);
		existedTags.appendChild(document.createTextNode("    "));
	    }
	}
	function swapTag(obj){
	    tag = obj.getAttribute("tagValue");
	    var post_tags = document.getElementById("post_tags");
	    post_tags.value = post_tags.value+tag+",";
	    post_tags.focus();
	}
    </script>
</head>
<body>
    <div id="post">
    $if post:
        <form action="admin/post/edit" method="POST"/>
            <input type="hidden" name="post_id" value="$post.id"/>
            <input type="hidden" name="originaltags" value="$post.tags"/>
            <table>
                <tr>
                    <th>title:</th>
                    <td>
                        <input type="text" name="post_title" value="$post.post_title" size="80"/>
                    </td>
                </tr>
                <tr>
                    <th>content:</th>
                    <td>
                        <textarea name="post_content" rows="8" cols="80">$post.post_content</textarea>
                    </td>
                </tr>
                <tr>
                    <th>tags:</th>
                    <td>
                        <input type="text" id="post_tags" name="post_tags" value="$post.tags" size="80"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <input type="submit" value="Submit"/>
                        <input type="reset" value="Reset"/>
                    </td>
                </tr>
            </table>
        </form>
    $else:
        <form action="/admin/post" method="POST"/>
            <table>
                <tr>
                    <th>title:</th>
                    <td>
                        <input type="text" name="post_title" size="80"/>
                    </td>
                </tr>
                <tr>
                    <th>content:</th>
                    <td>
                        <textarea name="post_content" rows="8" cols="80"></textarea>
                    </td>
                </tr>
                <tr>
                    <th>tags:</th>
                    <td>
                        <input type="text" id="post_tags" name="post_tags" size="80"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <input type="submit" value="Submit"/>
                        <input type="reset" value="Reset"/>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div id="tags">
        <script type="text/javascript">
            getTags();
        </script>
    </div>
    <div>
        $if post:
            <p>
                <form name="deleteform" action="/admin/post/delete" method="POST"/>
                    <input type="hidden" name="post_id" value="$post.id"/>
                    <input type="button" value="Delete this post" onclick="javascript:deletepost();"/>
                </form>
            </p>
        <p>
            <a href="/">back</a>
        </p>
    </div>
</body>
</html>